// ChimaeraSVN

// Copyright (C) 2008-2009 - ChimaeraSVN

// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

#pragma once

#pragma warning(push)
#include "svn_client.h"
#include "svn_pools.h"
#include "svn_config.h"
#pragma warning(pop)

#include "SVNPrompt.h"


class SVN
{
public:
	SVN(void);
	~SVN(void);
	
	
	BOOL List(const char *path_or_url, svn_boolean_t recurse);
	BOOL Checkout(const char *URL, const char *path, svn_boolean_t recurse);
	BOOL CreateProject(const char *path_or_url, svn_boolean_t recurse);
	BOOL getuserinfo(const char *path_or_url, svn_boolean_t recurse);
	BOOL get_new_message(const char *path_or_url, svn_boolean_t recurse);

	/* @1 the path copied from, @2 the full destinate path in server, 
	 * @3 the destinate path in working copy
	 * @4 maybe will be used later
	 */
	BOOL import_file(const char *source_path, const char *url, char *des_path,svn_boolean_t );
	BOOL update(const char *path, svn_boolean_t);

	

	svn_error_t *				Err;			///< Global error object struct
	svn_client_ctx_t * 			m_pctx;			///< pointer to client context

	apr_hash_t *				dirents;
	
	SVNPrompt					m_prompt;
	apr_pool_t *				parentpool;		///< the main memory pool
	apr_pool_t *				pool;			///< 'root' memory pool
	svn_opt_revision_t			rev;			///< subversion revision. used by getRevision()


	//global variaties
	static svn_string_t *		user_ID;
	static svn_revnum_t				recno;

	static char * privilege;
	static char * user_name;

	//get user_ID from the usb_key  
	//maybe should create a user class, anyway
	//just try here first.
	static svn_string_t * get_userID(char *);
protected:	
	

private:

};

